home *** CD-ROM | disk | FTP | other *** search
/ Imagesource 10: Kids / Image Source 10: Kids.iso / pc / demos / c-demos / demo089.dxr / Internal (lingo)_2.ls < prev    next >
Encoding:
Text File  |  1999-04-22  |  3.7 KB  |  131 lines

  1. on mouseDown
  2.   global gMouseDownScript
  3.   if gMouseDownScript = 1 then
  4.     hExitDemo()
  5.   end if
  6. end
  7.  
  8. on hExitDemo
  9.   cursor(4)
  10.   hDecreaseSound([1, 2], 0, 255)
  11.   set tMoviePath to hGetMoviePath()
  12.   go(1, tMoviePath)
  13. end
  14.  
  15. on hDecreaseSound pSoundChannel, pMinVolume, pMaxVolume
  16.   repeat with i = pMaxVolume down to pMinVolume
  17.     repeat with tSoundChannel in pSoundChannel
  18.       set the volume of sound tSoundChannel to i
  19.       updateStage()
  20.     end repeat
  21.   end repeat
  22.   repeat with tSoundChannel in pSoundChannel
  23.     puppetSound(tSoundChannel, 0)
  24.     updateStage()
  25.     set the volume of sound tSoundChannel to pMaxVolume
  26.   end repeat
  27. end
  28.  
  29. on hGetMoviePath
  30.   global gMouseDownScript, gDemoType
  31.   if gMouseDownScript = 1 then
  32.     set tMoviePath to hMoviePathToMenu()
  33.   else
  34.     case gDemoType of
  35.       "full":
  36.         set tMoviePath to hMoviePathToNextDemo()
  37.       "group":
  38.         set tMoviePath to hMoviePathToNextDemo()
  39.       "single":
  40.         set tMoviePath to hMoviePathToMenu()
  41.     end case
  42.   end if
  43.   return tMoviePath
  44. end
  45.  
  46. on hMoviePathToNextDemo
  47.   global gSectionTrackList, glDemos, gDemoType
  48.   set tCurrentSection to getLast(gSectionTrackList)
  49.   set tCurrentMovieCode to hGetCurrentMovieCode()
  50.   set tList to getProp(glDemos, value("#" & tCurrentSection))
  51.   set tPos to getOne(tList, tCurrentMovieCode)
  52.   set tLastPos to count(tList)
  53.   if tPos = tLastPos then
  54.     case gDemoType of
  55.       "full":
  56.         set tPos to findPos(glDemos, value("#" & tCurrentSection))
  57.         set tLastPos to count(glDemos)
  58.         if tPos = tLastPos then
  59.           set tNextSection to string(getPropAt(glDemos, 1))
  60.         else
  61.           set tNextSection to string(getPropAt(glDemos, tPos + 1))
  62.         end if
  63.         hDeleteFromSectionTrackList()
  64.         hAddToSectionTrackList(tNextSection)
  65.         set tMovieName to getAt(getProp(glDemos, value("#" & tNextSection)), 1)
  66.         if the machineType = 256 then
  67.           set the itemDelimiter to "\"
  68.         else
  69.           set the itemDelimiter to ":"
  70.         end if
  71.         set tMoviePath to item 1 to the number of items in the pathName - 2 of the pathName
  72.         set the itemDelimiter to ","
  73.         if the machineType = 256 then
  74.           set tMoviePath to tMoviePath & "\" & tNextSection & "-demos" & "\" & tMovieName
  75.         else
  76.           set tMoviePath to tMoviePath & ":" & tNextSection & "-demos" & ":" & tMovieName
  77.         end if
  78.       "group":
  79.         set tMoviePath to hMoviePathToMenu()
  80.     end case
  81.   else
  82.     set tMoviePath to getAt(getProp(glDemos, value("#" & tCurrentSection)), tPos + 1)
  83.   end if
  84.   return tMoviePath
  85. end
  86.  
  87. on hMoviePathToMenu
  88.   global gDemoType, gSectionTrackList, gProductNumber
  89.   if the machineType = 256 then
  90.     set the itemDelimiter to "\"
  91.   else
  92.     set the itemDelimiter to ":"
  93.   end if
  94.   set tMoviePath to item 1 to the number of items in the pathName - 2 of the pathName
  95.   set the itemDelimiter to ","
  96.   case gDemoType of
  97.     "full":
  98.       set tMovieName to gProductNumber & "MAIN"
  99.     "group", "single":
  100.       set tMovieName to gProductNumber & getLast(gSectionTrackList)
  101.   end case
  102.   if the machineType = 256 then
  103.     set tMoviePath to tMoviePath & "\" & tMovieName
  104.   else
  105.     set tMoviePath to tMoviePath & ":" & tMovieName
  106.   end if
  107.   return tMoviePath
  108. end
  109.  
  110. on hGetCurrentMovieCode
  111.   global gProductNumber
  112.   set tMovieName to the movieName
  113.   set the itemDelimiter to "."
  114.   set tCurrentMovieCode to item 1 of tMovieName
  115.   set the itemDelimiter to ","
  116.   return tCurrentMovieCode
  117. end
  118.  
  119. on hAddToSectionTrackList pSection
  120.   global gSectionTrackList
  121.   if voidp(gSectionTrackList) = 1 then
  122.     set gSectionTrackList to []
  123.   end if
  124.   add(gSectionTrackList, pSection)
  125. end
  126.  
  127. on hDeleteFromSectionTrackList
  128.   global gSectionTrackList
  129.   deleteAt(gSectionTrackList, count(gSectionTrackList))
  130. end
  131.